<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateResumesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('resumes', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('用户id');
            $table->integer('owner_id')->comment('拥有者id');
            $table->integer('company_id')->comment('公司id');
            $table->string('name',12)->comment('姓名')->nullable();
            $table->string('image',255)->comment('个人图像')->nullable();
            $table->enum('sex',['男','女'])->comment('性别(男,女)')->nullable();
            $table->string('mobile',64)->comment('手机号')->nullable();
            $table->string('area',64)->comment('籍贯')->nullable();
            $table->integer('job_date')->default(0)->comment('参加工作时间')->nullable();
            $table->integer('birthday')->default(0)->comment('出生日期')->nullable();
            $table->tinyInteger('is_job')->default(0)->comment('工作状态(1:在职候选,2:离职候选,3:已入职,4:已离职)');
            $table->string('position',255)->comment('目标岗位')->nullable();
            $table->string('edu',64)->nullable()->comment('学历')->nullable();
            $table->string('company_name',255)->nullable()->comment('最近一家公司名称');
            $table->string('attachment',255)->nullable()->comment('简历附件');
            $table->string('advantage',140)->nullable()->comment('我的优势');
            $table->string('url',255)->nullable()->comment('社交网址');
            $table->integer('flow_id')->nullable()->comment('流程id');
            $table->integer('step_id')->default(0)->comment('步骤id');
            $table->string('step_name',255)->default('新简历')->nullable()->comment('步骤名称');
            $table->integer('team_id')->nullable()->comment('群聊id');
            $table->integer('count')->default(0)->comment('轮次');
            $table->tinyInteger('check_status')->default(0)->comment('审核状态 1：通过 2:未通过 3：待定');
            $table->tinyInteger('ask_status')->default(0)->comment('邀约状态 1：通过 2：未通过 3：待定');
            $table->tinyInteger('status')->default(0)->comment('是否删除 1：是 0：否');
            $table->integer('created_at')->comment('创建时间');
            $table->integer('updated_at')->comment('最后更新时间');
        });
        DB::statement("ALTER TABLE `resumes` comment '简历表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('resumes');
    }
}
